<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="/epms/static/Style/skin.css" />
	<script type="text/javascript" src="/epms/static/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript">
		function doSearch() {
		//document.getElementById("pageIndex").value = index;
		document.getElementById("sform").submit();
		document.getElementById("sform1").submit();
	}
	</script>
    <!--弹窗样式-->
    <style type="text/css">
        .black_overlay{  
    display: none;  
    position: absolute;  
    top: 0%;  
    left: 0%;  
    width: 100%;  
    height: 100%;  
    background-color: black;  
    z-index:1001;  
    -moz-opacity: 0.8;  
    opacity:.50;  
    filter: alpha(opacity=50);  
}  
.white_content {  
    display: none;  
    position: absolute;  
    top: 35%;  
    left: 33%;  
    width: 36%;  
    border: 2px solid #d3d3d3;  
    background-color: white;  
    z-index: 1002;  
    /* overflow: auto; */  
}  
.white_content_small {  
    display: none;  
    position: absolute;  
    top: 20%;  
    left: 30%;  
    width: 40%;  
    height: 50%;  
    border: 16px solid lightblue;  
    background-color: white;  
    z-index:1002;  
    overflow: auto;  
} 
tr{
    text-align:center;
    vertical-align:middle;
}
    </style>	    
}
</head>
    <body>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <!-- 头部开始 -->
            <tr>
                <td width="17" valign="top" background="/epms/static/images/mail_left_bg.gif">
                    <img src="/epms/static/images/left_top_right.gif" width="17" height="29" />
                </td>
                <td valign="top" background="/epms/static/images/content_bg.gif">
                    <table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" background=".//epms/static/images/content_bg.gif">
                        <tr><td height="31"><div class="title">制定流程</div></td></tr>
                    </table>
                </td>
                <td width="16" valign="top" background="/epms/static/images/mail_right_bg.gif"><img src="/epms/static/images/nav_right_bg.gif" width="16" height="29" /></td>
            </tr>
            <!-- 中间部分开始 -->
            <tr>
                <!--第一行左边框-->
                <td valign="middle" background="/epms/static/images/mail_left_bg.gif">&nbsp;</td>
                <!--第一行中间内容-->
                <td valign="top" bgcolor="#F7F8F9">
                <form action="${pageContext.request.contextPath }/insertProcess.html" method="post" id="sform">
                    <table style="width:100%" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                   
                        <!-- 空白行-->
                        <tr><td colspan="2" valign="top">&nbsp;</td><td>&nbsp;</td><td valign="top">&nbsp;</td></tr>
						<tr>
						 
							<td colspan="4">
								<!-- <form class="clearfix"> -->
								
									<div style="float:left">
									<%-- <form action="${pageContext.request.contextPath }/insertProcess.html" method="get" id="sform1"> --%>
										<p style="float:left; margin-left:30px;"><label>选择项目：</label>
                                            <select style="width:100px;" name="makeproject">
                                                <option value="">请选择项目</option>
                                                <c:forEach items="${projectlist}" var="p">
                                                	<option value="${p.projectid}">${p.projectname}</option>
                                                </c:forEach>
                                            </select>

										<p style="float:left; margin-left:30px;"><label>输入流程名：</label>
										<select style="width:100px;" name="makeprocess">
                                                <option value="">请选择流程</option>
                                                <c:forEach items="${processList}" var="p">
                                                	<option value="${p.processid}">${p.type }</option>
                                                </c:forEach>
                                            </select>
										<!-- <input name="inProjectName" class="text" value="" placeholder="输入流程名" /> -->&nbsp&nbsp&nbsp&nbsp</p>
										<!-- </form> -->
									</div>
									<div style="float:left">
										<input type="button" onclick="javasrcipt:ShowDiv('MyDiv','fade')" class="btn" value="添加步骤"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
										
									</div>
								
							<td>
						</tr>
                        <!-- 一条线 -->
                        <tr>
                            <td height="40" colspan="4">
                                <table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
                                    <tr><td></td></tr>
                                </table>
                            </td>
                        </tr>
                        <!-- 列表展示开始 -->
                        <tr>
                            <td width="2%">&nbsp;</td>
                            <td width="96%">
                                <table width="100%">
                                    <tr>
                                        <td colspan="2">
                                           
                                                <table width="100%"  class="cont tr_color" id="list">
                                                    <tr>
                                                        <th>序号</th>
                                                        <th>步骤</th>
                                                        <th>名称</th>
                                                        <th>审批人</th>
                                                        
                                                        <th>操作</th>
                                                    </tr>
                                                    <!--
                                                    <tr align="center" class="d">
                                                   		<td>1</td>
                                                        <td>第1步</td>
                                                        <td>组长审批</td>
														
                                                        <td>
															<a href="#">修改</a>&nbsp;&nbsp;
                                                        	
                                                            <a href="#" onclick="javascript:confirm('确定删除该计划吗？')">删除</a>&nbsp;&nbsp;
                                                           
														</td>
                                                    </tr>
                                                    -->
                                                    
                                                   
                                                </table>
                                               
                                                
                                                <input type="hidden" id="index" value="0" />
                                           <!--  </form> -->
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td width="2%">&nbsp;</td>
                        </tr>
                        <!--列表展示结束 -->
                        <tr>
                            <td height="40" colspan="4">
                                <table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
                                    <tr><td></td></tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td width="2%">&nbsp;</td>
                            <td width="51%" class="left_txt">
                           		
								<!--
								<a href="list_manager.html">销售经理</a>&nbsp;&nbsp;&nbsp;
								<a href="list_director.html">销售总监</a>
								-->
								 <div id="formhidden"></div>
                                <!-- <a href="/epms/static/default.html"> --><input type="submit" value="提交" onclick="javascript:tijiao()"/><!-- </a> -->&nbsp;&nbsp;&nbsp;
                                <input type="button" onclick="javascript:history.back(-1)" value="返回" />
                            	
                            </td>
                            <td>&nbsp;</td><td>&nbsp;</td>
                             
                        </tr>
                       
                    </table>
                    </form>
                </td>
                <td background="/epms/static/images/mail_right_bg.gif">&nbsp;</td>
            </tr>
            <!-- 底部部分 -->
            <tr>
                <td valign="bottom" background="/epms/static/images/mail_left_bg.gif">
                    <img src="/epms/static/images/buttom_left.gif" width="17" height="17" />
                </td>
                <td background="/epms/static/images/buttom_bgs.gif">
                    <img src="/epms/static/images/buttom_bgs.gif" width="17" height="17">
                </td>
                <td valign="bottom" background="/epms/static/images/mail_right_bg.gif">
                    <img src="/epms/static/images/buttom_right.gif" width="16" height="17" />
                </td>           
            </tr>
        </table>


        <!--弹出层时背景层DIV---start-->  
<div id="fade" class="black_overlay"></div>  
<div id="MyDiv" class="white_content">  
    <div style="text-align: right; cursor: default; margin-top:10px;margin-bottom:10px;">  
        <span style="font-size: 16px; margin-right: 17px; color: #56BE2D; font-weight: 600;cursor:pointer;"  onclick="CloseDiv('MyDiv','fade')">关闭</span>  
    </div>  
    <div class="itempanel" style="    margin-left: 13%;">
        <label>步骤名：</label><input class="text" value="" id="name" name="name" placeholder="输入流程名" /> <br><br><br> 
        <label>审核人：</label>
        <select style="width:100px;" id="user">
            <option value="0">请选审核人</option>
            <c:forEach items="${userlist}" var="u">
            <%-- <input type="hidden" value="${u.userid }" id="useridhidden" /> --%>
            	<option value="${u.username}">${u.username }</option>
            </c:forEach>
        </select>
         
        <div class="floatleft message"></div>  
        <div class="clear"></div>  
    </div>  
    <HR style="FILTER: alpha(opacity=100,finishopacity=0,style=3); margin-top: 39px;" width="90%" color=#ddd SIZE=2>  
    <div style="margin-bottom: 23px; margin-top: 23px; margin-left: 23%;align:center">  
        <input type="button" class="greenbutton2" style="width: 123px" onclick="javasrcipt:goToAdd()" value="添加">  &nbsp;&nbsp;&nbsp;
        <input type="button" class="greenbutton2" style="width: 123px;" onclick="CloseDiv('MyDiv','fade')" value="取消">  
    </div>  
</div>  
<!-- <input type='hidden' name='shenpiming'/><input type='hidden' name='shenpiren'/> -->

<!--弹出层时背景层DIV---end-->

    <script type="text/javascript">
        function ShowDiv(show_div,bg_div){  
        var scrollHeight = document.body.scrollHeight; //文档高度  
        document.getElementById(bg_div).style.height=scrollHeight+'px';  
          
        document.getElementById(show_div).style.display='block';  
        document.getElementById(bg_div).style.display='block';  
        }; 
        //确定按钮  
        function goToAdd()  
        {  
            var name = document.getElementById("name").value;
            var user = document.getElementById("user").value;
            var index = document.getElementById("index").value;
            //var userid = document.getElementById("useridhidden").value;
            var indexafter = parseInt(index) + 1; 
            document.getElementById("index").value= indexafter;
            var list = document.getElementById("list");
            var listvalue = document.getElementById("list").value;
            var oneRow = list.insertRow();//插入一行  
            var cell1= oneRow.insertCell();//单单插入一行是不管用的，需要插入单元格  
            var cell2=oneRow.insertCell();
            var cell3=oneRow.insertCell();
            var cell4=oneRow.insertCell();
            var cell5=oneRow.insertCell();  
            cell1.innerHTML = indexafter;   
            cell2.innerHTML="第"+indexafter+"步";
            cell3.innerHTML = name; 
            cell4.innerHTML = user; 
            /* <a href='#'>修改</a>&nbsp;&nbsp; */
            cell5.innerHTML = "<a href='#' onclick='javascript:removeroute()'>删除</a>&nbsp;&nbsp;";
			
            
            
           // var formhiddenvalue = document.getElementById("formhidden").value;
            //document.getElementById("formhidden").value =  formhiddenvalue + "<input type='hidden' name='shenpiming' value='"+name+"'/><input type='hidden' name='shenpiren' value='"+user+"'/>";
            /* document.getElementById("formhidden").innerHTML = "<input type='hidden' name='shenpiming' value="+name+"/>"; */
            
            var formhiddenvalue = $("#formhidden").html();
            var formhiddenvalueafter = formhiddenvalue + "<input type='hidden' name='shenpiming' value='"+name+"'/><input type='hidden' name='shenpiren' value='"+user+"'/>";
            $("#formhidden").html(formhiddenvalueafter);
            
            document.getElementById("MyDiv").style.display='none';  
            document.getElementById("fade").style.display='none';  
        }; 
        //关闭弹出层  
        function CloseDiv(show_div,bg_div)  
        {  
            
            document.getElementById(show_div).style.display='none';  
            document.getElementById(bg_div).style.display='none';  
        };  
        //关闭弹出层  
        function CloseDiv2()  
        {  
            document.getElementById("MyDiv").style.display='none';  
            document.getElementById("fade").style.display='none';  
        };  
        function tijiao()  
        {  
        	//alert("aaa");
        	var formhiddenvalue = $("#formhidden").html();
        	
        	alert(formhiddenvalue);
        	//top.location="${pageContext.request.contextPath }/insertProcess.html?shenpiming="+formhiddenvalue;
        	 
        };
        function removeroute(){
    		var falg = confirm('确定删除该计划吗？')
    		if(falg){
    			$(this).remove();
    		}
    	}
    </script>
    </body>
</html>